#!/bin/bash

CONF_DIR=/app/config
LIB_DIR=/app/lib
LIB_JARS=`ls $LIB_DIR|grep .jar|awk '{print "'$LIB_DIR'/"$0}'|tr "\n" ":"`
JAVA_OPTS=" -Djava.net.preferIPv4Stack=true -Dfile.encoding=utf-8"
JAVA_MEM_OPTS=" -server -Xss1M -XX:MaxRAMPercentage=75.0 -XX:SurvivorRatio=2 -XX:+UseParallelGC "

BINMAIN=com.javasm.cloud.uaa.UserApplication
START_CMD="java $JAVA_OPTS $JAVA_MEM_OPTS -classpath $CONF_DIR:$LIB_JARS $BINMAIN"
STOP_CMD="kill $PID"
echo $START_CMD
$START_CMD
